package cn.com.lyb.flink.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

public class CollectionDemo {

    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        // 从集合读取数据
        DataStreamSource<Integer> source =

                // 等价
                 env.fromElements(1,22,33,44,55,66,77,88,99,11,12,13);
                // env.fromCollection(Arrays.asList(1, 22, 3));
        source.print();
        env.execute();
    }
}
